package com.yanqu.road.server.cmd.kuang.cross;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.kuang.Kuang;
import com.yanqu.road.server.GameServer;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.kuang.KuangMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.protocol.GameProtocol;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = GameProtocol.S_KUANG_GET_USER_ABILITY_RANK_FROM_CROSS, desc = "跨服获取赚钱数据")
public class KuangGetUserAbilityRankFromCrossCmd implements Command {

    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        Kuang.KuangUserAbilityRankListReqFromCrossMsg respMsg = Kuang.KuangUserAbilityRankListReqFromCrossMsg.parseFrom(packet.getBytes());
        if (respMsg.getTargetServerId() != GameServer.getInstance().getServerId()) {
            return;
        }
        KuangMgr.getPatronsAbilityUserRankByCmd(respMsg.getOriginUserId());
    }

}
